import request from "@/utils/request";
// 登录
export function login(params) {
  return request({
    url: "/admin/member/login",
    method: "post",
    params
  });
}
// 环信注册
export function MemberEasemob(params) {
  return request({
    url: "/admin/member/easemob",
    method: "post",
    params
  });
}

// 获取个人信息
export function getInfo() {
  return request({
    url: "/admin/member/getMemberInfo",
    method: "post"
  });
}
// 获取商户信息
export function getPlatInfo(params) {
  return request({
    url: '/dinner/ICBC/getPlatInfo',
    method: 'post',
    params
  })
}

// 获取用户信息
export function getMemberInfo(memberId) {
  return request({
    url: "/admin/member/getMemberInfo",
    method: "post",
    params: {
      memberId
    }
  });
}
// 修改个人信息
export function updateMember(data) {
  return request({
    url: "/admin/member/updateMember",
    method: "post",
    data
  });
}

// 企业信息认证(，企业认证信息)
export function authMemberInfo(data) {
  return request({
    url: "/admin/member/authMemberInfo",
    method: "post",
    data
  });
}

// 修改密码
export function passwordUpdate(params) {
  return request({
    url: "/admin/member/passwordUpdate",
    method: "post",
    params
  });
}

// 忘记密码
export function passwordForget(params) {
  return request({
    url: "/admin/member/passwordForget",
    method: "post",
    params
  });
}

// 登出
export function logout() {
  return request({
    url: "/admin/member/logout",
    method: "post"
  });
}

// 验证码 type:1修改手机号,2修改密码,3忘记密码，5登录,6注册
export function sendCode(params) {
  return request({
    url: "/common/sendCode",
    method: "post",
    params
  });
}

// 注册
export function register(params) {
  return request({
    url: "/admin/member/register",
    method: "post",
    params
  });
}
/**
 * 收藏夹
 * @param {*} params
 */
// 取消收藏（商品或店铺）。支持批量
export function collect(params) {
  return request({
    url: "/dinner/collect/collect",
    method: "post",
    params
  });
}

// 商品-分页
export function collectProduct(params) {
  return request({
    url: "/dinner/collect/product/pageByQo",
    method: "post",
    params
  });
}

// 店铺-分页
export function collectShop(params) {
  return request({
    url: "/dinner/collect/shop/pageByQo",
    method: "post",
    params
  });
}

// 推荐用户-分页
export function memberPageByQo2(params) {
  return request({
    url: "/admin/member/pageByQo2",
    method: "post",
    params
  });
}

// 推荐用户-分页
export function frontRegister(params) {
  return request({
    url: "/front/member/register",
    method: "post",
    params
  });
}
// 收藏夹-浏览记录
export function productBrowsingHistory(params) {
  return request({
    url: "/dinner/collect/productBrowsingHistory",
    method: "post",
    params
  });
}

// 获取vip会员总数
export function getVipCount(params) {
  return request({
    url: "/common/vipStatistics",
    method: "post",
    params
  });
}

//按推荐人手机号抓取客户关系
export function getCustomerRelation(params) {
  return request({
    url: "/dinner/customer/relation/findByPhone",
    method: "post",
    params,
    timeout: 60000
  });
}

// B2C认证
export function b2cAuth(params) {
  return request({
    url: "/dinner/ICBC/b2c/confirm/check",
    method: "post",
    params
  });
}

// 获取众茶通Scheme
export function getScheme(params) {
  return request({
    url: "/common/getScheme",
    method: "post",
    params
  });
}

// 获取提现记录
export function getWithdrawalRecord(params) {
  return request({
    url: "/withdrawalRecord/queryList",
    method: "post",
    params
  });
}

// 获取是否是经纪人
export function getMemberInfoHome(params) {
  return request({
    url: "/admin/member/getMemberInfoHome",
    method: "post",
    params
  });
}

// 获取众茶通openid
export function getOpenIdByCode(params) {
  return request({
    url: "/common/getOpenIdByCode",
    method: "get",
    params
  });
}

export function friendList(params) {
  return request({
    url: '/dinner/im/friend/list',
    method: 'post',
    params
  })
}

export function addFriend(params) {
  return request({
    url: '/dinner/im/private/message/addFriend',
    method: 'post',
    params
  })
}
